/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.controller;

import java.util.List;
import queenb.net.entitybean.A000;
import queenb.web.store.A000Store;
import queenb.web.util.Util;

/**
 *
 * @author Nguyen Hung
 */
public class CountrycityController extends QueenbController {

    private boolean flag;
    private int FN750;
    private List<A000> listA000;// city
    private int FV200;
    private int FK100;
    private int FA000;
    private String price;

    public CountrycityController() {
        Object actionObject = getRequest().getParameter("action");
        if (actionObject != null) {
            if (actionObject.equals("getidCountry")) {
                Object fn750Object = getRequest().getParameter("fn750");
                if (fn750Object != null) {
                    FN750 = Util.parseInt(fn750Object);
                    listA000 = getListCityAll(FN750);
                    System.out.println("------------- BOOSSS"+ listA000.size());
                }

            }else if(actionObject.equals("countrycity")){
                Object fv200Object = getRequest().getParameter("fv200");
                if (fv200Object != null) {
                    FV200 = Util.parseInt(fv200Object);
                    
                }
                Object fk100Object = getRequest().getParameter("fk100");
                if (fk100Object != null) {
                    FK100 = Util.parseInt(fk100Object);
                    
                }
               // Object fa000Object = getRequest().getParameter("fa000");
                Object priceObject = getRequest().getParameter("price");
                if (priceObject != null) {
                    price = priceObject.toString();
                    
                }
                
                 System.out.println("------------- VARS ---"+ FV200+FK100+price);
            }
        }
    }

    public List<A000> getListCityAll(int id) {
        A000Store store = new A000Store();
        try {
            List<A000> listS200 = store.findAllA000Forcountry(id, getLogin().getUserName());
            return listS200;
        } catch (Exception e) {
            return null;
        }
    }

    /**
     * @return the flag
     */
    public boolean isFlag() {
        return flag;
    }

    /**
     * @param flag the flag to set
     */
    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    /**
     * @return the FN750
     */
    public int getFN750() {
        return FN750;
    }

    /**
     * @param FN750 the FN750 to set
     */
    public void setFN750(int FN750) {
        this.FN750 = FN750;
    }

    /**
     * @return the listA000
     */
    public List<A000> getListA000() {
        return listA000;
    }

    /**
     * @param listA000 the listA000 to set
     */
    public void setListA000(List<A000> listA000) {
        this.listA000 = listA000;
    }

    /**
     * @return the FV200
     */
    public int getFV200() {
        return FV200;
    }

    /**
     * @param FV200 the FV200 to set
     */
    public void setFV200(int FV200) {
        this.FV200 = FV200;
    }

    /**
     * @return the FK100
     */
    public int getFK100() {
        return FK100;
    }

    /**
     * @param FK100 the FK100 to set
     */
    public void setFK100(int FK100) {
        this.FK100 = FK100;
    }

    /**
     * @return the FA000
     */
    public int getFA000() {
        return FA000;
    }

    /**
     * @param FA000 the FA000 to set
     */
    public void setFA000(int FA000) {
        this.FA000 = FA000;
    }

    /**
     * @return the price
     */
    public String getPrice() {
        return price;
    }

    /**
     * @param price the price to set
     */
    public void setPrice(String price) {
        this.price = price;
    }
}
